<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%> 
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>

    
<div id="newGoonContainer">   
	<spring:url value="/goon/edit" var="saveURL" />
	<%-- 
	<form:form method="post" action="${saveURL}" modelAttribute="goon">
		<div class="row">
			<form:label path="name">Name</form:label><form:input path="name" />
		</div>
		<div class="row">
			<form:label path="description">Description</form:label><form:input path="description" />
		</div>
		<div class="row">
			<form:label path="dob">Date of Birth</form:label><form:input path="dob" />
		</div>
		<div class="button-section">
			<input type="button" value="Add" />
			<input type="hidden" value="<spring:url value="/goon/edit" ></spring:url>" name="saveURL" />
			<input type="submit" value="Add - Form sub" />
		</div>
	</form:form>
	--%>
	<form action="${saveURL}" id="goonForm">
		<input type="hidden" name="mode" value="save" />
		<div class="row">
			<label>Name</label><input type="text" name="details.name" />
		</div>
		<div class="row">
			<label>Description</label><input type="text" name="details.description" />
		</div>
		<div class="row">
			<label>Date of Birth</label><input type="date" name="details.dob"/>
		</div>
		<div class="button-section">
			<input type="button" value="Add" name="save" />
			<input type="hidden" value="<spring:url value="/goon/edit" ></spring:url>" name="saveURL" />
			<input type="button" value="Add - JSON" name="saveJSON" />
			<input type="hidden" value="<spring:url value="/goon/editJson" ></spring:url>" name="saveJsonURL" />
		</div>
	</form>
	
</div>

